#ifndef								__UDPSERVER_H__
#define								__UDPSERVER_H__

#include							<QtNetwork/QUdpSocket>
#include							<qobject.h>
#include							<list>
#include							"handler.h"
#include							"packet.h"
#include							"QtAsyncUdpSocket.h"

class								UdpServer : public QObject
{
	Q_OBJECT

public:
	UdpServer(PacketHandler *);
	~UdpServer();

public:
	void							connectToClient(const std::string &, const std::string &);
	void							sendPacket(Packet *, QHostAddress &ip, quint16 port = 4244);
	void							disconnect(unsigned int id);

private:
	QtAsyncUdpSocket				_socket;
	PacketHandler					*_packet;
};

#endif								// !__UDPSERVER_H__
